#include "input_event_manager.h"
#include "4_buttons.h"

const InputEventConfig_t input_event_config = 
{
	/* Table to convert from PIO to input event ID*/
	{
		 0,  2, -1, -1, -1,  3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
		-1, -1, -1, -1,  1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 
		-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
	},

	/* Masks for each PIO bank to configure as inputs */
	{ 0x00100023UL, 0x00000000UL, 0x00000000UL },
	/* PIO debounce settings */
	4, 5
};


const InputActionMessage_t default_message_group[21] = 
{
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD,                                   /* Action */
		3000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_HELD_3SEC,                /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		1,                                      /* Count */
		LI_MFB_BUTTON_SINGLE_PRESS,             /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_PLUS,                               /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		1,                                      /* Count */
		APP_BUTTON_VOLUME_UP,                   /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD,                                   /* Action */
		6000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_HELD_6SEC,                /* Message */
	},
	{
		0,                                      /* Input event bits */
		ANC,                                    /* Input event mask */
		HELD_RELEASE,                           /* Action */
		3000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		APP_BUTTON_GAMING_MODE,                 /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_MINUS,                              /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		2,                                      /* Count */
		APP_BUTTON_VOLUME_DOWN2,                /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD_RELEASE,                           /* Action */
		6000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_RELEASE_6SEC,             /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD,                                   /* Action */
		2000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_HELD_2SEC,                /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD_RELEASE,                           /* Action */
		3000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_RELEASE_3SEC,             /* Message */
	},
	{
		SYS_CTRL | VOL_PLUS,                    /* Input event bits */
		SYS_CTRL | VOL_PLUS,                    /* Input event mask */
		HELD,                                   /* Action */
		3000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_POWER_OFF,                /* Message */
	},
	{
		0,                                      /* Input event bits */
		ANC,                                    /* Input event mask */
		HELD,                                   /* Action */
		6000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		APP_BUTTON_ANC_TUNNING,                 /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_MINUS,                              /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		1,                                      /* Count */
		APP_BUTTON_VOLUME_DOWN,                 /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL | VOL_PLUS,                    /* Input event mask */
		HELD,                                   /* Action */
		6000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		ENTER_DUT_MODE,                         /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_MINUS | VOL_PLUS,                   /* Input event mask */
		HELD,                                   /* Action */
		4700,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		RESET_PAIRED_DEVICE_LIST,               /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		2,                                      /* Count */
		LI_MFB_BUTTON_DOUBLE_PRESS,             /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD_RELEASE,                           /* Action */
		1000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_RELEASE_1SEC,             /* Message */
	},
	{
		SYS_CTRL,                               /* Input event bits */
		SYS_CTRL,                               /* Input event mask */
		HELD,                                   /* Action */
		1000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		LI_MFB_BUTTON_HELD_1SEC,                /* Message */
	},
	{
		0,                                      /* Input event bits */
		ANC,                                    /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		1,                                      /* Count */
		APP_BUTTON_ANC,                         /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_PLUS,                               /* Input event mask */
		HELD,                                   /* Action */
		1000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		APP_BUTTON_FORWARD,                     /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_PLUS,                               /* Input event mask */
		MULTI_CLICK,                            /* Action */
		0,                                      /* Timeout */
		0,                                      /* Repeat */
		2,                                      /* Count */
		APP_BUTTON_VOLUME_UP2,                  /* Message */
	},
	{
		0,                                      /* Input event bits */
		VOL_MINUS,                              /* Input event mask */
		HELD,                                   /* Action */
		1000,                                   /* Timeout */
		0,                                      /* Repeat */
		0,                                      /* Count */
		APP_BUTTON_BACKWARD,                    /* Message */
	},
};


ASSERT_MESSAGE_GROUP_NOT_OVERFLOWED(LOGICAL_INPUT,MAX_INPUT_ACTION_MESSAGE_ID)

